home *** CD-ROM | disk | FTP | other *** search
/ NOVA - For the NeXT Workstation / NOVA - For the NeXT Workstation.iso / Documents / NeXTAnswers / appkit.15 < prev    next >
Text File  |  1992-02-06  |  2KB  |  35 lines

  1. {\rtf0\ansi{\fonttbl\f2\fnil Times-Roman;\f0\fmodern Courier;}
  2. \paperw13040
  3. \paperh10200
  4. \margl120
  5. \margr120
  6. {\colortbl\red0\green0\blue0;}
  7. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f2\b0\i0\ul0\fs28 active application appkit main launch\
  8. \
  9. Q:  How can I make an application launch and become the active app?\
  10. Q:  Why don't I get 
  11. \b windowDidBecomeKey
  12. \b0  and 
  13. \b windowDidBecomeMain
  14. \b0  messages when my application is launched? \
  15. \
  16. A:  
  17. \fc0 Normally, applications should not need to ever worry about activating themselves. When Workspace launches an application it deactivates itself, and then it activates the application as its completes the launch.  It sends the application the message 
  18. \b activateSelf:
  19. \b0 NO and this results in the behavior where the application will become active if the user waits for it, but will not interrupt the user by becoming active if the user began using a different application in the meantime.\
  20. \
  21. The reason for this is the need for predictable consistent behavior in a multitasking system.  Imagine you double-click an Edit file.  Edit begins to launch.  You activate Shell and start typing.  When Edit finishes launching, do you want it to take over as the active app and suddenly start grabbing the keystrokes you intended for Shell?  Probably not.  Edit will only become the active app if you wait for it to launch and don't activate another app.\
  22. \
  23. A:  You also will not receive 
  24. \b windowDidBecomeKey
  25. \b0  and 
  26. \b windowDidBecomeMain
  27. \b0  messages until your application becomes active.  The key and main window of an app have no meaning when the app is inactive. \
  28. \
  29. \
  30. QA15\
  31. \
  32. Valid for 2.0\
  33. \
  34.  
  35.